import type { FormField, TableColumn } from '@/components'
import { reactive } from 'vue'

export const fields = reactive<FormField[]>([
  {
    tag: 'ElInput',
    key: 'planName',
    label: '抽查计划',
    placeholder: '请输入计划名称',
    attrs: {}
  }
])

export const columns: TableColumn[] = [
  {
    key: 'planName',
    label: '抽查计划'
  },
  {
    key: 'year',
    label: '年度'
  },
  {
    key: 'actions',
    label: '操作',
    slot: true,
    fixed: 'right',
    width: 120
  }
]

export const dialogFields = reactive<FormField[]>([
  {
    tag: 'ElInput',
    key: 'planName',
    label: '年度计划',
    placeholder: '请输入年度计划',
    attrs: {},
    validateRules: [
      {
        required: true,
        message: '请输入',
        trigger: 'change'
      }
    ]
  }
])

export const tableData = async () => {
  return {
    data: {
      total: 40,
      records: [
        {
          name: '2023年度统计“双随机”抽查'
        }
      ]
    }
  }
}
